﻿using System;
using System.Collections.Generic;
using System.Text;

using YouHP.Model;
using YouHP.DALFactory;
using YouHP.Utility;

namespace YouHP.BLL
{
    public class UserActionBLL
    {
        #region Singleton
        static UserActionBLL _Instance;
        public static UserActionBLL Instance
        {
            get
            {
                if (_Instance == null)
                {
                    _Instance = new UserActionBLL();
                }
                return _Instance;
            }
        }
        #endregion

        #region basic operations
        public bool AddUserAction(UserActionInfo info)
        {
            return DataAccess.UserActionDAL.AddUserAction(info);
        }

        public bool DeleteUserAction(int[] ids)
        {
            return DataAccess.UserActionDAL.DeleteUserAction(ids);
        }

        #endregion

        #region list and search operations
        public List<UserActionInfo> GetLatestUserActionList(int pageSize, int pageIndex, int days, out int count)
        {
            return DataAccess.UserActionDAL.GetLatestUserActionList(pageSize, pageIndex, days, out count);
        }

        public List<UserActionInfo> GetUserActionByUserId(int pageSize, int pageIndex, int uid,int days,out int count)
        {
            return DataAccess.UserActionDAL.GetUserActionByUserId(pageSize ,pageIndex ,uid,days, out count);
        }

        public List<UserActionInfo> GetFriendActionList(int pageSize, int pageIndex, int uid, int days, out int count)
        {
            return DataAccess.UserActionDAL.GetFriendActionList(pageSize, pageIndex, uid, days, out count);
        }

        public List<UserActionInfo> GetAllFriendActionList(int uid, int days)
        {
            return DataAccess.UserActionDAL.GetAllFriendActionList(uid,days);
        }
        public List<UserActionInfo> GetPatientsLikeMeActionList(int uid,int diseaseId, int days)
        {
            return DataAccess.UserActionDAL.GetPatientsLikeMeActionList(uid,diseaseId, days);
        }
        #endregion


    }
}